package com.nuaa.qianru.service;

import com.nuaa.qianru.dao.StrategyDao;
import com.nuaa.qianru.model.Method;
import com.nuaa.qianru.model.Problem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.LinkedList;


@Service
public class StrategyService {
    @Autowired
    private StrategyDao strategyDao;

    public Problem getStrategyById(int id) {
        return  strategyDao.selectStrategyById(id);
    }

    public void addMethodById(LinkedList<Method> methods, int pid){
        for(Method method:methods){
            strategyDao.insertMethod(method,pid);
        }
        }

}
